﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataLibrary.Utility
{
    public class ParseNumHelper
    {
        public static string NumToString(object obj)
        {
            decimal num = Convert.ToDecimal(obj);
            if (num == 0)
            {
                return "--";
            }
            return num.ToString();
        }

        public static bool IsVisibleIndicator(object yesterdayNum, object compareNum)
        {
            if (Convert.ToDouble(yesterdayNum)== 0 || Convert.ToDouble(compareNum) == 0)
            {
                return false;
            }

            return true;
        }

        public static int DataTableRowToInt(object obj)
        {
            if (obj != DBNull.Value && obj != null)
            {
                return Convert.ToInt32(obj);
            }
            return 0;
        }
    }
}
